package com.example.demo.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import com.example.demo.entity.FoodType;



@Repository
public interface FoodType_Mapper extends Basic_Mapper<FoodType> {
	
	@Select("select * from FoodType ${where} ${limit}")
	public List<FoodType> select(@Param("where")String where,@Param("limit") String limit);
	
	@Delete("delete from FoodType where id=#{id}")
	public void delete(int id);
	@Options(useGeneratedKeys = true,keyColumn = "id",keyProperty = "id")
	@Insert("insert into FoodType(name) values(#{name})")
	public void insert(FoodType t);
	
	@Update("update FoodType set name=#{name} where id=#{id}")
	public void update(FoodType t);
	
	@Select("select * from FoodType where id=#{id}")
	public FoodType getById(int id);
}
